package com.tc.activiti.activiti.activiti.listener;

import com.tc.activiti.activiti.util.UserUtil;
import com.tc.activiti.user.entity.SysUser;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Service;

/**
 * @author zengqingfa
 * @date 2019/10/30 15:20
 * @description
 * @email zengqingfa_java@163.com
 * 任务监听器
 */
@Service
public class DepartmentManagerTaskListener implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        //获取到当前登录人的部门
        SysUser user = UserUtil.currentUser.get();
        //根据用户id查询部门id
        delegateTask.setAssignee("3");

    }
}
